package com.bitoon.basketdudes.web.jpa;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Entity
@Table(name = "correo_total", schema="central")
@NamedQueries({
})
public class CorreoTotal implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected CorreoTotalPK correoTotalPK;

    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    
    private short total;


    public CorreoTotal() {
    }

    public CorreoTotal(CorreoTotalPK correoTotalPK) {
        this.correoTotalPK = correoTotalPK;
    }

    public CorreoTotal(String email, int moduloId) {
        this.correoTotalPK = new CorreoTotalPK(email, moduloId);
    }

    public CorreoTotalPK getCorreoTotalPK() {
        return correoTotalPK;
    }

    public void setCorreoTotalPK(CorreoTotalPK correoTotalPK) {
        this.correoTotalPK = correoTotalPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (correoTotalPK != null ? correoTotalPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CorreoTotal)) {
            return false;
        }
        CorreoTotal other = (CorreoTotal) object;
        if ((this.correoTotalPK == null && other.correoTotalPK != null) || (this.correoTotalPK != null && !this.correoTotalPK.equals(other.correoTotalPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bitoon.basketdudes.web.jpa.CorreoTotal[correoTotalPK=" + correoTotalPK + "]";
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public short getTotal() {
        return total;
    }

    public void setTotal(short total) {
        this.total = total;
    }

}
